<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title><spring:message code='Multimedia.resource.list'/></title>
	<meta name="decorator" content="default"/>
    <style>
        .jbox-content{
            overflow: hidden!important;
        }
    </style>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }

        function preview(type, groupId) {
            if ('video' == type) {
                top.$.jBox.open("iframe:${ctx}/source/video/eleSourceVideoGroup/preview?groupId=" + groupId, "preview", 500, 420, {showScrolling: false});
            } else {
                top.$.jBox.open("iframe:${ctx}/source/image/eleSourceImageGroup/preview?groupId=" + groupId, "preview", 500, 420, {showScrolling: false});
            }
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active">
			<a href="${ctx}/source/eleSourceMultimedia/">
				<spring:message code='Multimedia.resource.list'/>
			</a>
		</li>
		<shiro:hasPermission name="source:eleSourceMultimedia:edit">
			<li>
				<a href="${ctx}/source/eleSourceMultimedia/form">
					<spring:message code="Multimedia.resource.add"/>
				</a>
			</li>
		</shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="eleSourceMultimedia" action="${ctx}/source/eleSourceMultimedia/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label><spring:message code="common.dname"/>：</label>
				<form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="<spring:message code='common.Query'/>"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th><spring:message code="common.dname"/></th>
				<th><spring:message code='common.update_time'/></th>
				<th><spring:message code='common.creater'/></th>
				<th><spring:message code='audit.state'/></th>

				<th><spring:message code='common.operation'/></th>
				<th><spring:message code='common.remarks'/></th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="eleSourceMultimedia">
			<tr>
				<td><a href="${ctx}/source/eleSourceMultimedia/form?id=${eleSourceMultimedia.id}">${eleSourceMultimedia.name}</a></td>
				<td>
					<fmt:formatDate value="${eleSourceMultimedia.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
					</td>
					<td>
					${eleSourceMultimedia.createBy.name}
					</td>
				<td>
					<c:if test="${eleSourceMultimedia.group != null}">
                    <c:if test="${eleSourceMultimedia.group.delFlag == '0'}">
                       <spring:message code="approved"/>
                    </c:if>
                    <c:if test="${eleSourceMultimedia.group.delFlag == '1'}">
                        <spring:message code='common.delete'/>
                    </c:if>
                    <c:if test="${eleSourceMultimedia.group.delFlag == '2'}">
                        <spring:message code='inapproval'/>
                    </c:if>
                    <c:if test="${eleSourceMultimedia.group.delFlag == '3'}">
                        <spring:message code="rejected"/>
                    </c:if>
                    </c:if>
                </td>

					<td>
						<shiro:hasPermission name="source:eleSourceMultimedia:edit">
						<a href="${ctx}/source/eleSourceMultimedia/form?id=${eleSourceMultimedia.id}"><spring:message code="common.modify"/></a>
						<a href="${ctx}/source/eleSourceMultimedia/applypublish?id=${eleSourceMultimedia.id}"><spring:message code="publish"/></a>
						<a href="${ctx}/source/eleSourceMultimedia/delete?id=${eleSourceMultimedia.id}"
						   onclick="return confirmx('<spring:message code="tips.deleteconfirm"/>', this.href)">
							<spring:message code='common.delete'/>
						</a>
						</shiro:hasPermission>

                        <c:if test="${'video' == eleSourceMultimedia.type}">
                            <a href="javascript:void(0);" onclick="preview('${eleSourceMultimedia.type}','${eleSourceMultimedia.videoId}')">
                                <spring:message code="preview"/>
                            </a>
                        </c:if>

                        <c:if test="${'image' == eleSourceMultimedia.type}">
                            <a href="javascript:void(0);" onclick="preview('${eleSourceMultimedia.type}','${eleSourceMultimedia.imageId}')">
                                <spring:message code="preview"/>
                            </a>
                        </c:if>
					</td>
				<td>
						${eleSourceMultimedia.remarks}
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>